﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Streaming_Service.User {
    using System.Text.RegularExpressions;

    public class UserRegex {
        public static bool ValidName(string name) {
            return name != null && Regex.IsMatch(name, @"^[a-zA-Z0-9 -]{3,}$");
        }

        public static bool ValidPassword(string pw) {
            return pw != null && Regex.IsMatch(pw, @"^.{3,}$");
        }

        public static bool ValidEmail(string email) {
            return email != null && Regex.IsMatch(email, @"^[a-z0-9_+~-]+(\.[a-z0-9_+~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+(?:[a-z]{2}|com|org|net|edu|gov|mil|biz|info|mobi|name|aero|asia|jobs|museum)$");
        }
    }
}